# import numpy as np
#
# a = np.arange(6).reshape(2, 3)
# print('原始数组是：')
# print(a)
# print('\n')
# print('迭代输出元素：')
# # C默认是行读取，F是列读取， op_flags默认是read_only
# for ele in np.nditer(a, order="C", op_flags=['readwrite']):
#     ele *= 2
#     print(ele, end = " ")
# print()
# print(a)

import numpy as np
a = np.arange(0,60,5).reshape(3, 4)
b = np.array([1, 2, 3, 4])
print(a)
print(b)

for x, y in np.nditer([a, b]):
    print(f"{x}->{y}", end = " ")
# flags参数默认输出0维数据， external_loop则是输出一维数组
# for x in np.nditer(a, flags =  ['external_loop'], order =  'F'):
#    print (x, end=", " )